Other Protocols
The following protocols are available globally.
-
A protocol that feature subclasses (i.e. those already conforming to the
MGLFeatureprotocol) conform to if they represent clusters.Currently the only class that conforms to
MGLClusterisMGLPointFeatureCluster(a subclass ofMGLPointFeature).To check if a feature is a cluster, check conformity to
MGLCluster, for example:
See morelet shape = try! MGLShape(data: clusterShapeData, encoding: String.Encoding.utf8.rawValue) guard let pointFeature = shape as? MGLPointFeature else { throw ExampleError.unexpectedFeatureType } // Check for cluster conformance guard let cluster = pointFeature as? MGLCluster else { throw ExampleError.featureIsNotACluster } // Currently the only supported class that conforms to `MGLCluster` is // `MGLPointFeatureCluster` guard cluster is MGLPointFeatureCluster else { throw ExampleError.unexpectedFeatureType } -
Data source for
See moreMGLComputedShapeSource. This protocol defines two optional methods for fetching data, one based on tile coordinates, and one based on a bounding box. Classes that implement this protocol must implement one, and only one of the methods. Methods on this protocol will not be called on main thread, they will be called on the caller’srequestQueue.Declaration
Objective-C
@protocol MGLComputedShapeSourceDataSource <NSObject>Swift
protocol MGLComputedShapeSourceDataSource : NSObjectProtocol -
Optional methods about significant events when creating a snapshot using an
See moreMGLMapSnapshotterobject.Declaration
Objective-C
@protocol MGLMapSnapshotterDelegate <NSObject>Swift
protocol MGLMapSnapshotterDelegate : NSObjectProtocol -
The
See moreMGLOfflineStorageDelegateprotocol defines methods that a delegate of anMGLOfflineStorageobject can optionally implement to transform various types of URLs before downloading them via the internet.Declaration
Objective-C
@protocol MGLOfflineStorageDelegate <NSObject>Swift
protocol MGLOfflineStorageDelegate : NSObjectProtocol -
Declaration
Objective-C
@protocol MGLStylable <NSObject>Swift
protocol MGLStylable : NSObjectProtocol
Install in Dash
Other Protocols Reference